__author__ = 'zoulida'

from functools import lru_cache

from tools.StockList import get_all_stock3


@lru_cache
def getStockList():
    return get_all_stock3()
def transformCode(code = '000001'):#功能是将6位的code转换为9位的，sz.000001
    stockdf = getStockList()
    #print(stockdf)
    code9d = stockdf.loc[stockdf['symbol'] == code, 'ts_code'].item()
    #print(code9d)
    return code9d

if __name__ == '__main__':
    transformCode()
